package com.xteam.youin_supplier.config;


import com.xteam.youin_supplier.util.MD5;

/**
 * Created by puman on 15/7/21.
 */
public class RequestAddr {


    //访问服务器地址
//    private static String baseUrl = "http://122.226.199.116:9696/beautyfarm/";//测试
//    private static String Ip = "http://122.226.199.116/";
//    private static String Ip = "http://qyh.puman.cn/";
//    private static String Ip = "http://115.159.6.217/";
    private static String Ip = "http://139.196.190.42/";
    private static String baseUrl = Ip + "youin/supplier/";//生产
    public static String imageUrl = Ip + "youins/image/";  //图片地址
//    public static String webUrl = Ip + "imagenotes/upload/wap/";//网页地址


    // 加密字符串
    private static String timeStamp = "";
    private static String safeStr = "public_key=bf_mob_app&timestamp=" + timeStamp + "&sign=" + getSign() + "&";
    private static String secret_key;//私钥
    private static String public_key;//公钥


    public static String login = getUrl("mine/login");  //登录
    public static String biddingList = getUrl("auction/auctionList");  //竞拍列表
    public static String biddingDetail = getUrl("auction/auctionDetail");  //竞拍详情
    public static String biddingResutlList = getUrl("auction/resultList");  //竞拍结果列表
    public static String biddingResultDetail = getUrl("auction/resultDetail");  //竞拍结果详情
    public static String addbedding = getUrl("auction/addCompetive");  //参与竞拍

    public static String baseInfo = getUrl("mine/mineBasic");  //基本信息
    public static String prvateSetShow = getUrl("mine/mineCompanyDetail");  //个人设置显示
    public static String prvateEdit = getUrl("mine/mineCompanyEdit");  //个人设置修改
    public static String stockManage = getUrl("mine/stockManage");  //进销存

    public static String reprotList = getUrl("report/reportList");  //报表列表
    public static String stationDetail = getUrl("report/gasstationDetail");  //加油点详情
    public static String addoilDetail = getUrl("report/gasDetail");  //加油详情
    public static String carTeamList = getUrl("report/carTeamList");  //车队列表
    public static String carTeamListSearch = getUrl("report/carTeamListSearch");  //车对列表--筛选
    public static String carList = getUrl("report/carList");  //车辆列表--点击车队列表
    public static String carListSearch = getUrl("report/carListSearch");  //车辆列表--点击筛选车队列表

    /**
     * 获取加密签名
     *
     * @return 加密后的签名
     */
    private static String getSign() {
        return MD5.getMD5ofStr("qzed_suj4+hzudl9zrqw9q" + "&"
                + "youin_app" + "&" + timeStamp);
    }


    /**
     * @return 从1970年1月1日至今的秒数
     */
    private static Long getTimestamp() {
        return System.currentTimeMillis();
    }

    /**
     * 拼接Url
     *
     * @param relativeUrl 相对地址
     * @return
     */
    private static String getUrl(String relativeUrl) {
        timeStamp = getTimestamp().toString();
        return baseUrl + relativeUrl + "?" + "public_key=youin_app&timestamp=" + timeStamp + "&sign=" + getSign() + "&";
    }
}
